<template>
  <div class="box5">
    <div class="title">
      <p>未来七天游客数量趋势图</p>
      <img src="../../images/dataScreen-title.png"
           alt="">
    </div>
    <div class="charts"
         ref='line'></div>
  </div>
</template>

<script setup lang='ts'>
import { onMounted, ref } from 'vue'
import * as echarts from 'echarts'
let line = ref()
onMounted(() => {
  let mycharts = echarts.init(line.value)
  mycharts.setOption({
    tooltip: {
      trigger: 'axis',
    },
    grid: {
      top: 23,
      left: 0,
      right: 0,
      bottom: 10,
      containLabel: true,
    },
    xAxis: {
      type: 'category',
      data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月'],
      axisLine: {
        show: false,
      },
      axisLabel: {
        color: '#CFCFCF',
        interval: 0,
        fontSize: 14,
      },
      axisTick: {
        show: false,
      },
    },
    yAxis: {
      type: 'value',
      axisLine: {
        show: false,
      },
      axisLabel: {
        show: true,
        color: '#CFCFCF',
        fontSize: 14,
      },

      splitLine: {
        show: false,
        lineStyle: {
          width: 0.8,
          color: 'rgba(127, 214, 255, .4)',
          type: 'dashed',
        },
      },
    },
    series: [
      {
        type: 'line',
        showSymbol: false,
        smooth: true,
        // symbolSize: 8,
        lineStyle: {
          color: '#00FFF6',
        },
        itemStyle: {
          color: '#00FFF6',
          borderColor: '#00FFF6',
          borderWidth: 2,
        },
        areaStyle: {
          color: {
            type: 'linear',
            x: 0,
            y: 0,
            x2: 0,
            y2: 1,
            colorStops: [
              {
                offset: 0.25,
                color: '#00FFF686',
              },
              {
                offset: 1,
                color: '#00FFF600',
              },
            ],
          },
        },
        data: [1100, 1200, 800, 900, 1000, 400, 500, 1200],
      },
    ],
  })
})
</script>
<style scoped lang='scss'>
.box5 {
  width: 100%;
  height: 100%;
  background: url(../../images/dataScreen-main-cb.png) no-repeat;
  background-size: 100% 100%;
  margin: 0px 20px;

  .title {
    margin-left: 10px;

    p {
      color: white;
      font-size: 16px;
    }
  }

  .charts {
    height: calc(100% - 40px);
  }
}
</style>